package veda;

import cn.hutool.core.date.StopWatch;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSON;
import com.example.eeuse.model.FareResult;
import com.example.eeuse.util.FareUtil;

import java.util.Comparator;
import java.util.List;
import java.util.Map;

public class SortVedaResult {
    public static void main(String[] args) {

        String respStr= FileUtil.readString("D:\\test\\20231225\\pre.txt","utf-8");
        VedaResult vedaResult= JSON.parseObject(respStr,VedaResult.class);
        writeSort(vedaResult,"D:\\test\\20231225\\pre_format.txt");

        respStr= FileUtil.readString("D:\\test\\20231225\\pro.txt","utf-8");
        vedaResult= JSON.parseObject(respStr,VedaResult.class);
        writeSort(vedaResult,"D:\\test\\20231225\\pro_format.txt");
    }


    public static void writeSort(VedaResult vedaResult, String fileName)
    {
        vedaResult.sort();
        String afterString=JSON.toJSONString(vedaResult);
        FileUtil.writeString(afterString,fileName,"utf-8");
    }
}
